//
//  NetFailView.m
//  Onskysell
//
//  Created by LJJ on 17/6/29.
//  Copyright © 2017年 cg. All rights reserved.
//

#import "NetFailView.h"

@interface NetFailView ()
@property (weak, nonatomic) IBOutlet UIButton *refreshBtn;
@property (weak, nonatomic) IBOutlet UIButton *backHomeBtn;
@property (weak, nonatomic) IBOutlet UILabel *notiLbl;//提示语
@property (weak, nonatomic) IBOutlet UILabel *resonLbl;

@end

@implementation NetFailView

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.refreshBtn.layer.borderColor = [UIColor clearColor].CGColor;
    self.backHomeBtn.layer.borderColor = [UIColor clearColor].CGColor;
}

- (IBAction)refreshClick:(id)sender {
    [NotificationCenter postNotificationName:RefreshNetNotification object:nil];
}

- (IBAction)backHomeClick:(id)sender {
    [NotificationCenter postNotificationName:NetFailBackHomeNoti object:nil];
}

- (void)setNoNetNotice
{
    NSMutableAttributedString *mStr = [[NSMutableAttributedString alloc] initWithString:NoNetToastStr];
//    NSRange range1 = [NoNetToastStr rangeOfString:@"Network Error"];
//    [mStr addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:range1];
//    [mStr addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17.0] range:range1];
//
//    NSRange range2 = [NoNetToastStr rangeOfString:@"Your device appears to have lost network connectivity"];
//    [mStr addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:range2];
//    [mStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16.0f] range:range2];
    
    self.notiLbl.attributedText = mStr;
}

- (void)showReasonLbl
{
    self.resonLbl.hidden = NO;
}
@end
